package sskj.regulatory.data.network

import sskj.regulatory.data.response.session.UserResponse
import io.reactivex.Flowable
import retrofit2.http.*
import sskj.regulatory.data.request.QrLoginRequest
import sskj.regulatory.data.response.Response
import sskj.regulatory.data.response.session.IndexDataResponse
import sskj.regulatory.data.response.session.TokenResponse
import sskj.regulatory.domain.entity.user.BingDingEntity


interface UserApiService {

    //获取用户信息
    @GET("user")
    fun getUser(): Flowable<UserResponse>

    //获取用户主页信息
    @GET("indexData")
    fun getIndexData(): Flowable<IndexDataResponse>

    //更新token
    @GET("refresh")
    fun refresh(): Flowable<TokenResponse>

    //绑定用户信息
    @POST("user/bingding/save")
    fun bingDing(@Body bingDingEntity: BingDingEntity): Flowable<Response>

    //删除绑定用户信息
    @DELETE("user/bingding/del")
    fun delBingDing(@Query("id") id: String): Flowable<Response>

    //项目部扫码登录
    @POST("auth/xmb/login")
    fun xmbQrLogin(@Body qrLoginRequest: QrLoginRequest): Flowable<Response>

    //项目部扫码登录确认
    @POST("auth/xmb/dologin")
    fun xmbDoQrLogin(@Body qrLoginRequest: QrLoginRequest): Flowable<Response>

}